package demo5;

/**
 * Created by Administrator on 2017/4/5.
 */
//: com:bruceeckel:tools:debug:Assert.java
// Assertion tool for debugging.
public class Assert {
    private static void perr(String msg) {
        System.err.println(msg);
    }

    public final static void is_true(boolean exp) {
        if (!exp) perr("Assertion failed");
    }

    public final static void is_false(boolean exp) {
        if (exp) perr("Assertion failed");
    }

    public final static void is_true(boolean exp, String msg) {
        if (!exp) perr("Assertion failed: " + msg);
    }

    public final static void is_false(boolean exp, String msg) {
        if (exp) perr("Assertion failed: " + msg);
    }
} ///:~